package com.yunjing.mvparmsdemo.mvp.api.service;

import com.yunjing.mvparmsdemo.mvp.api.Api;
import com.yunjing.mvparmsdemo.mvp.api.entity.NewListEntity;
import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import static com.yunjing.mvparmsdemo.mvp.api.Api.INPUT_HTTP_URL_NAME;
import static me.jessyan.retrofiturlmanager.RetrofitUrlManager.DOMAIN_NAME_HEADER;

public interface CommonService {

    //新闻
    @Headers({DOMAIN_NAME_HEADER + INPUT_HTTP_URL_NAME})
    @FormUrlEncoded
    @POST(Api.NewBaseUrl)
    Observable<NewListEntity> onNewListRequest(@Field("key") String key,
                                               @Field("page_size") int page_size,
                                               @Field("page") int page);

}
